#ifndef _CEFFECTMANAGER_H
#define _CEFFECTMANAGER_H

#include "Global Variables.h"
#include "CTexture.h"
#include "CAnimation.h"
#include "CGraphic.h"
#include "CResourceManager.h"
#include "CEffect.h"
#include <vector>

class CEffectManager
{
public:
	//------------------------------//
	//	Destructor fot this class	//
	//------------------------------//
	~CEffectManager();

	//----------------------//
	//	Enum : Effect index //
	//----------------------//
	enum EFFECT_INDEX { EFF_STRIKE = 0 ,
						EFF_BURST = 1};

	//------------------------------//
	//	Struct : Effect Information	//
	//------------------------------//
	struct EFFECT_INFO
	{
		int			index;
		int			imageIndex;
		int			numFrame;
		int			numFrameInRow;
		int			width;
		int			height;
		float		offsetX;
		float		offsetY;
		int			offsetWidth;
		int			offsetHeight;
		int			startFrame;
		int			endFrame;
		int			loopFrame;
		float		actionSpeed;

		EFFECT_INFO()
		{
			index			= 0;
			imageIndex		= 0;
			numFrameInRow	= 0;
			numFrame		= 0;
			offsetX			= 0.0f;
			offsetY			= 0.0f;
			width			= 0;
			height			= 0;
			startFrame		= 0;
			endFrame		= 0;
			loopFrame		= 0;
			actionSpeed		= 0.0f;
		}
	};

	//----------------------------------//
	//	Public methods for this class	//
	//----------------------------------//
	void		Init				( LPCTSTR DefineFile);
	void		StartEffect			( EFFECT_INDEX index , float posX , float posY , float velX , float velY , float timeLife );
	void		UpdateEffect		( float deltaTime );
	void		DrawEffect			( float camX = 0 , float camY = 0 );

	//----------------------------------//
	//	Static methods for this class	//
	//----------------------------------//
	static CEffectManager* GetInstance		( );

private:
	//--------------------------------------//
	//	Private Constructor for this class	//
	//--------------------------------------//
	CEffectManager();

	//--------------------------------------//
	//	Private variables for this class	//
	//--------------------------------------//
	EFFECT_INFO						*m_pEffecInfo;
	ULONG							 m_nEffectInfoCount;

	std::vector<CEffect*>			 m_listEffect;
	ULONG							 m_nCount;


	//------------------------------------------//
	//	Private Static variables for this class	//
	//------------------------------------------//
	static CEffectManager*			m_pEffect;
};


#endif